package com.warm.spring.bean.hero;

import com.warm.spring.ioc.condition.SaberCondition;
import com.warm.spring.bean.equip.Equip;
import com.warm.spring.bean.skill.Skill;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Conditional;
import org.springframework.stereotype.Component;

/**
 * @Description 剑圣 -- Setter
 * @Author iyb-liangchuang
 * @Date 2021/5/10 14:24
 */
@Component
@Conditional(SaberCondition.class)
public class SaberHero extends Hero {

    public static RoleEnum ROLE = RoleEnum.TOP;

    private Equip equip;
    private Skill skill;

    @Override
    public void figth(){
        System.out.println("Hero: Saber, Role: " + ROLE + ", Attack: " + attack(equip, skill));
    }

    @Autowired
    public void setSkill(@Qualifier("saberSkill") Skill skill) {
        this.skill = skill;
    }

    @Autowired
    public void setEquip(@Qualifier("swordEquip") Equip equip) {
        this.equip = equip;
    }
}
